<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>globalThis 全局对象</title>
</head>

<body>
    <script>
        // 浏览器
        console.log(window == globalThis); // true

        // node.js
        // console.log(global == globalThis); // true
    </script>
</body>

</html>